===============================================
TROUBLESHOOTING AGENT SYSTEM - MIKHMON
===============================================

MASALAH: Menu Agent Loading Terus / Tidak Muncul
===============================================

LANGKAH DEBUGGING:

1. CEK DATABASE CONNECTION
   -----------------------
   Akses: http://localhost/mikhmon/test_agent_db.php
   
   Jika error:
   - Pastikan database mikhmon_agents sudah dibuat
   - Cek kredensial di mikhmon/include/db_config.php
   - Pastikan MySQL service running

2. CEK FILE AGENT CLASS
   --------------------
   File: mikhmon/lib/Agent.class.php
   
   Pastikan file ada dan tidak ada syntax error:
   - Buka file dengan text editor
   - Cek tidak ada karakter aneh atau BOM
   - Pastikan semua function lengkap

3. CEK INCLUDE PATH
   ----------------
   Semua file di mikhmon/agent-admin/ TIDAK BOLEH ada:
   - session_start()
   - Auth check (sudah di index.php)
   - Include path harus: ./include/ bukan ../include/

4. CEK ERROR LOG
   -------------
   Windows: xampp/apache/logs/error.log
   Linux: /var/log/apache2/error.log
   
   Cari error terkait:
   - Fatal error
   - Parse error
   - Database connection error

5. ENABLE ERROR DISPLAY
   --------------------
   Edit mikhmon/index.php, ubah baris 18:
   
   Dari: error_reporting(0);
   Jadi: error_reporting(E_ALL);
         ini_set('display_errors', 1);

6. CEK BROWSER CONSOLE
   -------------------
   Tekan F12 di browser
   Tab Console - cek JavaScript error
   Tab Network - cek HTTP request error

7. INSTALL ULANG DATABASE
   ----------------------
   Akses: http://localhost/mikhmon/install_agent_system.php
   
   Atau manual:
   - Buka phpMyAdmin
   - Import mikhmon/database/agent_system.sql
   - Pastikan 3 table terbuat: agents, agent_prices, agent_transactions

8. CEK MENU INTEGRATION
   --------------------
   File: mikhmon/include/menu.php
   
   Pastikan ada menu Agent Management dengan link:
   - agent-setup
   - agent-list
   - agent-add
   - agent-prices
   - agent-topup
   - agent-transactions

SOLUSI CEPAT:
=============

1. Restart Apache/MySQL
2. Clear browser cache (Ctrl+Shift+Del)
3. Coba browser lain (Chrome/Firefox)
4. Cek file permissions (chmod 755)

KONTAK SUPPORT:
===============
Jika masih error, kirim screenshot:
1. Browser console (F12)
2. Error log Apache
3. Hasil test_agent_db.php

===============================================
